package com.hxzy.shop.commodity.convert;//package com.yimeng.shop.config;

import com.hxzy.shop.commodity.dto.req.AddDrugReq;
import com.hxzy.shop.entity.Drug;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

@Mapper
public interface DrugConvert {
    DrugConvert INSTANCE = Mappers.getMapper(DrugConvert.class);


    @Mappings({
            @Mapping(source = "drugId", target = "id")
    })
     Drug addDrugreq2Drug(AddDrugReq addDrugReq);

    //drug-->AddDrugReq
    AddDrugReq  drugToAddDrugReq(Drug drug);
}